//Erstellt von Moritz Liepe
package main.editor;

import java.util.UUID;

import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.handlers.HandlerUtil;

public class OpenVOSEditorHandler extends AbstractHandler 
{

	@Override
	public Object execute(ExecutionEvent event) throws ExecutionException 
	{
		VOSEditorInput vosEditorInput = new VOSEditorInput(UUID.randomUUID().toString());
		try 
		{
			HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().openEditor(vosEditorInput, VOSEditor.class.getCanonicalName());
		}
		catch (PartInitException e) 
		{
			e.printStackTrace();
		}
		return null;
	}

}
